﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.DataAccessLayer;

namespace BingZi.HY.Core.Entities.Center
{
	/// <summary>
	/// 地区信息
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("地区信息")]
	[BindTable("app_AreaInfo", Description = "地区信息", ConnName = "Center", DbType = DatabaseType.SqlServer)]
	public partial class app_AreaInfo
	{
		#region 属性
		private Int32 _A_Id;
		/// <summary>
		/// 编号
		/// </summary>
		[Description("编号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "A_Id", "编号", "", "int", 10, 0, false)]
		public Int32 A_Id
		{
			get { return _A_Id; }
			set { if (OnPropertyChange("A_Id", value)) _A_Id = value; }
		}

		private Int32 _A_ParentID;
		/// <summary>
		/// 上级编号
		/// </summary>
		[Description("上级编号")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(2, "A_ParentID", "上级编号", "0", "int", 10, 0, false)]
		public Int32 A_ParentID
		{
			get { return _A_ParentID; }
			set { if (OnPropertyChange("A_ParentID", value)) _A_ParentID = value; }
		}

		private String _A_Name;
		/// <summary>
		/// 地区名
		/// </summary>
		[Description("地区名")]
		[DataObjectField(false, false, false, 20)]
		[BindColumn(3, "A_Name", "地区名", "", "nvarchar(20)", 0, 0, true)]
		public String A_Name
		{
			get { return _A_Name; }
			set { if (OnPropertyChange("A_Name", value)) _A_Name = value; }
		}

		private String _A_Pinyin;
		/// <summary>
		/// 拼音
		/// </summary>
		[Description("拼音")]
		[DataObjectField(false, false, false, 100)]
		[BindColumn(4, "A_Pinyin", "拼音", "", "varchar(100)", 0, 0, false)]
		public String A_Pinyin
		{
			get { return _A_Pinyin; }
			set { if (OnPropertyChange("A_Pinyin", value)) _A_Pinyin = value; }
		}

		private Int32 _A_ShowOrder;
		/// <summary>
		/// 显示顺序
		/// </summary>
		[Description("显示顺序")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(5, "A_ShowOrder", "显示顺序", "0", "int", 10, 0, false)]
		public Int32 A_ShowOrder
		{
			get { return _A_ShowOrder; }
			set { if (OnPropertyChange("A_ShowOrder", value)) _A_ShowOrder = value; }
		}

		private Int32 _A_Level;
		/// <summary>
		/// 当前分类所在层数
		/// </summary>
		[Description("当前分类所在层数")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(6, "A_Level", "当前分类所在层数", "", "int", 10, 0, false)]
		public Int32 A_Level
		{
			get { return _A_Level; }
			set { if (OnPropertyChange("A_Level", value)) _A_Level = value; }
		}

		private Int32 _A_ChildCount;
		/// <summary>
		/// 当前分类子分类数
		/// </summary>
		[Description("当前分类子分类数")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(7, "A_ChildCount", "当前分类子分类数", "", "int", 10, 0, false)]
		public Int32 A_ChildCount
		{
			get { return _A_ChildCount; }
			set { if (OnPropertyChange("A_ChildCount", value)) _A_ChildCount = value; }
		}

		private Int32 _A_Delete;
		/// <summary>
		/// 是否删除1:是0:否
		/// </summary>
		[Description("是否删除1:是0:否")]
		[DataObjectField(false, false, true, 3)]
		[BindColumn(8, "A_Delete", "是否删除1:是0:否", "", "tinyint", 3, 0, false)]
		public Int32 A_Delete
		{
			get { return _A_Delete; }
			set { if (OnPropertyChange("A_Delete", value)) _A_Delete = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "A_Id" : return _A_Id;
					case "A_ParentID" : return _A_ParentID;
					case "A_Name" : return _A_Name;
					case "A_Pinyin" : return _A_Pinyin;
					case "A_ShowOrder" : return _A_ShowOrder;
					case "A_Level" : return _A_Level;
					case "A_ChildCount" : return _A_ChildCount;
					case "A_Delete" : return _A_Delete;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "A_Id" : _A_Id = Convert.ToInt32(value); break;
					case "A_ParentID" : _A_ParentID = Convert.ToInt32(value); break;
					case "A_Name" : _A_Name = Convert.ToString(value); break;
					case "A_Pinyin" : _A_Pinyin = Convert.ToString(value); break;
					case "A_ShowOrder" : _A_ShowOrder = Convert.ToInt32(value); break;
					case "A_Level" : _A_Level = Convert.ToInt32(value); break;
					case "A_ChildCount" : _A_ChildCount = Convert.ToInt32(value); break;
					case "A_Delete" : _A_Delete = Convert.ToInt32(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得地区信息字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 编号
			///</summary>
			public const String A_Id = "A_Id";

			///<summary>
			/// 上级编号
			///</summary>
			public const String A_ParentID = "A_ParentID";

			///<summary>
			/// 地区名
			///</summary>
			public const String A_Name = "A_Name";

			///<summary>
			/// 拼音
			///</summary>
			public const String A_Pinyin = "A_Pinyin";

			///<summary>
			/// 显示顺序
			///</summary>
			public const String A_ShowOrder = "A_ShowOrder";

			///<summary>
			/// 当前分类所在层数
			///</summary>
			public const String A_Level = "A_Level";

			///<summary>
			/// 当前分类子分类数
			///</summary>
			public const String A_ChildCount = "A_ChildCount";

			///<summary>
			/// 是否删除1:是0:否
			///</summary>
			public const String A_Delete = "A_Delete";
		}
		#endregion
	}
}